//
//  Message.m
//  SDDataTest
//
//  Created by sodao on 12-9-19.
//  Copyright (c) 2012年 sodao. All rights reserved.
//

#import "Message.h"

@implementation Message
@synthesize dateLongLongValue;
@synthesize unReadCount;
@synthesize msgType;//消息类型。1：赞消息;2：评论消息;4:关注消息
@synthesize date;
@synthesize show;
@synthesize attentioner;
@synthesize favourer;
@synthesize comment;

- (void)encodeWithCoder:(NSCoder *)aCoder{
    [super encodeWithCoder:aCoder];
    [aCoder encodeObject:self.dateLongLongValue forKey:kEncodeMessage_dateLongLongValue];
    [aCoder encodeInt32:self.unReadCount forKey:kEncodeMessage_unReadCount];
    [aCoder encodeInt32:self.msgType forKey:kEncodeMessage_msgType];
    [aCoder encodeObject:self.date forKey:kEncodeMessage_date];
    [aCoder encodeObject:self.show forKey:kEncodeMessage_show];
    [aCoder encodeObject:self.attentioner forKey:kEncodeMessage_attentioner];
    [aCoder encodeObject:self.favourer forKey:kEncodeMessage_favourer];
    [aCoder encodeObject:self.comment forKey:kEncodeMessage_comment];

}
- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        self.dateLongLongValue = [decoder decodeObjectForKey:kEncodeMessage_dateLongLongValue];
        self.unReadCount = [decoder decodeInt32ForKey:kEncodeMessage_unReadCount];
        self.msgType = [decoder decodeInt32ForKey:kEncodeMessage_msgType];
        self.date = [decoder decodeObjectForKey:kEncodeMessage_date];
        self.show = [decoder decodeObjectForKey:kEncodeMessage_show];
        self.attentioner = [decoder decodeObjectForKey:kEncodeMessage_attentioner];
        self.favourer = [decoder decodeObjectForKey:kEncodeMessage_favourer];
        self.comment = [decoder decodeObjectForKey:kEncodeMessage_comment];
    }
    return self;
}
-(id)initWithDictionary:(NSDictionary*)dictionary{
    self = [super initWithDictionary:dictionary];
    if (self) {
        
    }
    return self;
}
-(void)dealloc{
    [super dealloc];
    if(self.dateLongLongValue)[self.dateLongLongValue release];
    if (self.date)[self.date release];
    if (self.show)[self.show release];
    if (self.attentioner)[self.attentioner release];
    if (self.favourer)[self.favourer release];
    if (self.comment)[self.comment release];
}










@end
